package com.gjy.util;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-02-09 13:53:19
 */
public class StreamUtil {

    public static <T> List<T> page(List<T> list, Integer num, Integer size) {
        int start = (num - 1) * size;
        return list.stream()
                .skip(start)
                .limit(size)
                .collect(Collectors.toList());
    }
}
